<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改第三方系统对接')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-accounts-edit" th:object="${supAccounts}">
            <input name="supId" th:field="*{supId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商家编码：</label>
                <div class="col-sm-8">
                    <input name="supCode" th:field="*{supCode}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商家名称：</label>
                <div class="col-sm-8">
                    <input name="supName" th:field="*{supName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数据库地址：</label>
                <div class="col-sm-8">
                    <input name="jdbcUrl" th:field="*{jdbcUrl}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数据库用户名：</label>
                <div class="col-sm-8">
                    <input name="jdbcUsername" th:field="*{jdbcUsername}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数据库密码：</label>
                <div class="col-sm-8">
                    <input name="jdbcPassowrd" th:field="*{jdbcPassowrd}" class="form-control" type="password">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数据库驱动：</label>
                <div class="col-sm-8">
                    <input name="jdbcDriver" th:field="*{jdbcDriver}" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                        <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">最新同步时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="lastSynTime" id="lastSynTime" th:value="${#dates.format(supAccounts.lastSynTime, 'yyyy-MM-dd HH:mm:ss')}" class="form-control"
                               placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "supplier/accounts";

        $(function(){

            $("input[name='lastSynTime']").datetimepicker({
                format: "yyyy-mm-dd hh:ii:ss",
                autoclose: true
            });

            laydate.render({
                elem: '#lastSynTime',
                type: 'datetime',
                trigger: 'click'
            });
        });

        $("#form-accounts-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-accounts-edit').serialize());
            }
        }

    </script>
</body>
</html>